package com.hshoesmall.demo.controller;
import com.hshoesmall.demo.common.api.ApiResult;
import com.hshoesmall.demo.mapper.UserInfoMapper;

import com.hshoesmall.demo.model.entity.Brand;
import com.hshoesmall.demo.model.entity.UserInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api")
public class UserInfoController {
    @Resource
    UserInfoMapper userInfosMapper;

    //获取所有用户信息的接口
    @PostMapping("/userInfos") //get请求
    public ApiResult<List<UserInfo>> getUserInfos(){
        userInfosMapper.findAllUserInfos();
        List<UserInfo> allUserInfos = userInfosMapper.findAllUserInfos();
        return ApiResult.success(allUserInfos) ;
    }

}

